﻿using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class show_teacher : System.Web.UI.Page
{
    public string x;
    protected void Page_Load(object sender, EventArgs e)
    {
        string b = Request.QueryString["bh"];
        string strConnection = "Provider=Microsoft.Jet.OleDb.4.0 ;Data Source=|DataDirectory|\\web.mdb";
        OleDbConnection objConnection = new OleDbConnection(strConnection);
        objConnection.Open();
        string sql = "select * from ty_teacher where id=" + b;
        OleDbCommand cmd = new OleDbCommand(sql, objConnection);
        OleDbDataReader reader = cmd.ExecuteReader();
        if (reader.Read())//从数据库读取用户信息
        {

            string q, w, r, t, y, u, i, o, p;
            q = reader["ty_message"].ToString();
            w = reader["ty_pic"].ToString();
            r = reader["ty_name"].ToString();
            t = reader["ty_job"].ToString();
            y = reader["ty_sex"].ToString();
            u = reader["ty_mingzhu"].ToString();
            i = reader["ty_addr"].ToString();
            o = reader["ty_maj"].ToString();

            Label1.Text = r.Trim(); Label8.Text = r.Trim();
            Label2.Text = t.Trim(); Label3.Text = u.Trim();
            Label4.Text = i.Trim(); Label5.Text = y.Trim();
            Label6.Text = o.Trim();
            x = w.Trim();
        }
        reader.Close();
        objConnection.Close();
    }
}